#pragma once

#include "Common.h"

// 单例模式
class CentralCache
{
public:
	static CentralCache* GetInstance()// 单例模式，返回静态成员的指针，确保单例
	{
		return &_sInst;
	}

	Span* GetOneSpan(SpanList& list, size_t size);

	size_t FetchRangeObj(void*& start, void*& end, size_t batchNum, size_t size);

private:
	SpanList _spanLists[NFREELIST];

	static CentralCache _sInst;

	CentralCache() {};

	CentralCache(const CentralCache&) = delete;// 禁用引用构造

};